package com.lck.blogmanager.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lck.blogmanager.entity.BlogEntity;
import com.lck.blogmanager.req.PageBlogReq;
import com.lck.blogmanager.req.UserBlogListReq;
import com.lck.blogmanager.res.PageBlogRes;
import com.lck.blogmanager.res.UserBlogListRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Component
@Mapper
public interface BlogMapper extends BaseMapper<BlogEntity> {


    Page<PageBlogRes> pageBlog(@Param("req") PageBlogReq req,
                               Page page);

    Page<UserBlogListRes> userList(@Param("req") UserBlogListReq req,
                                   Page page);

    Page<PageBlogRes> userCenterPageBlog(@Param("req") PageBlogReq req,
                                         @Param("userId") Integer userId,
                                         Page page);
}
